

{% load static %}
<!doctype html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>登录</title>
    <!-- Bootstrap 5 CDN -->
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
    <!-- 你的 form 放这里 -->
    <div class="container mt-5">
        <div class="card shadow" style="max-width:400px;margin:auto;">
            <div class="card-body">
                <form action="" method="post" >
                    {% csrf_token %}

                    <div class="mb-3">
                        <label class="form-label">{{ form.username.label }}</label>
                        {{ form.username }}
                        {% if form.username.errors %}
                        {% for error in form.username.errors %}
                            <div class="alert alert-danger" role="alert">
                            {{ error }}
                            </div>
                        {% endfor %}
                        {% endif %}
                    </div>
                    <div class="mb-3">

                        <label class="form-label">{{ form.password.label }}</label>
{#                        {{ form.password }}#}
                        {{ form.password }}
                        {% if form.password.errors %}
                        {% for error in form.password.errors %}

                            <div class="alert alert-danger" role="alert">
                            {{ error }}
                            </div>
                        {% endfor %}
                        {% endif %}
                    </div>

                    <button type="submit" class="btn btn-primary w-100">登录</button>
                    <br>
                    <br>
                    <br>
                    <a class="btn btn-primary w-100" href="{% url 'user:register' %}">没有账号，去注册</a>

                </form>
            </div>
        </div>
    </div>

    <!-- Bootstrap 5 JS（可选，若需要交互组件） -->
    <script src="/static/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>